Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow to set changeDynamics(body, link, contactProcessingThreshold) f… #3096

Merged
merged 6 commits into from
Oct 7, 2020
Merged

Conversation

erwincoumans
Copy link
Member

…or multibodies

(set to 0 if restitution is important)

…or multibodies

(set to 0 if restitution is important)
…ePluginCommand. Also add python binding.

Currently the return data has to fit in shared memory, 8MB (Linux, Windows) or 1MB (Apple)
Preparation for streaming is added (to allow unlimited return data, see CMD_CUSTOM_COMMAND_STREAM_RETURN_DATA)

New C-API: b3GetStatusPluginCommandReturnData
PyBullet reports return data if available, in pybullet_executePluginCommand

For the plugin developer:
plugin can provide additional return data for executePluginCommand in the b3PluginContext, during executePluginCommand.
Lifetime of this m_returnData pointer is minimum of next call to the next executePluginCommand or plugin termination.
re-use existing code path for streaming plugin return data (work-in-progress)
@erwincoumans
Copy link
Member Author

erwincoumans commented Oct 7, 2020

example to receive return data from a plugin in Python:

import pybullet as p
p.connect(p.DIRECT)
pluginId = p.loadPlugin("tinyRendererPlugin")
print(pluginId)
data = p.executePluginCommand(pluginId, "test", [1,2,3,4,5,6,7,8,9], [0.1,0.3,0.5])
print("data=",data)

or in C-API

command = b3CreateCustomCommand(sm);
b3CustomCommandExecutePluginCommand(command, pluginUniqueId, textArgument);
...
struct b3UserDataValue dv;
if (b3GetStatusPluginCommandReturnData(sm, &dv))
{
  //use dv.m_data1/dv.m_length etc
}

Some example return data in the tinyrenderer plugin:

https://github.com/bulletphysics/bullet3/blob/master/examples/SharedMemory/plugins/tinyRendererPlugin/tinyRendererPlugin.cpp#L46

Make sure the lifetime of the return data is either until the plugin terminates, or until the next 'executePluginCommand'.

@erwincoumans erwincoumans merged commit afa73c2 into bulletphysics:master Oct 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant